﻿using System;

namespace Pathfinder.Base.Utilities
{
    public static class Int32Extensions
    {
        /// <summary>
        /// Converts a normal number into the actual plus (or minus) of the stat.
        /// </summary>
        /// <param name="self">Pure stat number to convert.</param>
        /// <returns>Int bonus result</returns>
        public static int GetBonus(this int self)
        {
            return (int)Math.Floor((((double)self) - 10) / 2);
        }
    }
}
